package com.shenzhen.horselive.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;

import androidx.appcompat.app.AppCompatDialog;

import com.shenzhen.horselive.R;
import com.shenzhen.horselive.databinding.DialogLoginBinding;

public class LoginDialog extends Dialog {

    public LoginDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    public LoginDialog(Context context, int theme) {
        super(context, theme);
    }


    DialogLoginBinding   binding;
    public LoginDialog(Context context) {
        super(context, R.style.CommonDialog);
        //初始化
        binding = DialogLoginBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());


    }

    @Override
    public void show() {
        super.show();
        WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
        layoutParams.width= ViewGroup.LayoutParams.MATCH_PARENT;
        layoutParams.height= ViewGroup.LayoutParams.MATCH_PARENT;
        getWindow().setAttributes(layoutParams);
    }

    //确认
    public void setConfirm(View.OnClickListener onClickListener) {
        binding.btGo.setOnClickListener(onClickListener);
    }

    //取消
    public  void  setCancel(View.OnClickListener  onClickListener)
    {
        binding.btCancel.setOnClickListener(onClickListener);
    }


}
